/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.librairie;

import com.client.domain.Commande;
import com.client.domain.EtatCommande;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

@Stateless
@LocalBean
public class CommandeManager implements CommandeManagerRemote {
    
    @PersistenceContext
    private EntityManager entityManager;
    
    @Override
    public boolean addCommande(Integer utilisateur){
        try {
            Commande commande = new Commande(utilisateur);
            entityManager.persist(commande);      
            return true;
        } catch (Exception e) {
            return false;
        }

    }
    
}
